<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('member','header'); ?>
<div id="main">
  <?php include template('order' , 'left'); ?>
  <div id="right">
    <p id="position"> <strong>当前位置：</strong><a href="">首页</a><a href="<?php echo $MODULE['member']['url'];?>">会员中心</a><a href="<?php echo $M['url'];?>">订单</a>我的订单</p>
    <div class="clear"></div>
    <div class="clear"></div>
    <table cellpadding="0" cellspacing="1" class="table_list">
      <caption><?php if(isset($status)) { ?><?php echo $statusname;?><?php } else { ?>全部<?php } ?>订单</caption>
      <tr>
        <th>产品</th>
<th width="50">数量</th>
<th width="80">总金额</th>
        <th width="105">下单时间</th>
        <th width="70">状态</th>
<th width="120">操作</th>
      </tr>
  <?php if($data) { ?>
  <?php if(is_array($data)) foreach($data AS $r) { ?>
      <tr>
        <td class="align_l"><a href="<?php echo $r['goodsurl'];?>" target="_blank"><?php echo $r['goodsname'];?></a></td>
        <td><?php echo $r['number'];?><?php echo $r['unit'];?></td>
        <td><b><?php echo $r['amount'];?>元</b></td>
        <td style="color:gray"><?php echo date('Y-m-d H:i', $r[time]);?></td>
<td>
<?php echo $r['statusname'];?>
<?php if($r['status']==0) { ?><br /><a href="<?php echo $M['url'];?>index.php?action=pay&orderid=<?php echo $r['orderid'];?>"><span style="color:red">立即付款</span></a><?php } elseif ($r['status']==2) { ?><br /><a href="<?php echo $M['url'];?>index.php?action=receive&orderid=<?php echo $r['orderid'];?>"><span style="color:red">确认收货</span></a><?php } ?>
</td>
<td class="align_c">
<a href="<?php echo $M['url'];?>index.php?action=view&orderid=<?php echo $r['orderid'];?>">查看</a> | <a href="<?php echo $M['url'];?>index.php?action=memo&orderid=<?php echo $r['orderid'];?>">备注</a> | <?php if($r[status] == 0) { ?><a href="javascript:confirmurl('<?php echo url($M[url], 1);?>index.php?action=cancel&orderid=<?php echo $r['orderid'];?>', '取消该订单')" title="取消订单">取消</a><?php } else { ?><font color="#cccccc">取消</font><?php } ?>
        </td>
      </tr>
      <?php } ?>
  <?php } else { ?>
<tr><td colspan="6">暂无记录</td></tr>
  <?php } ?>
    </table>
    <div id="pages"><?php echo $pages;?></div>
  </div>
</div>
<div class="clear"></div>
<?php include template('member','footer'); ?>